<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="./socket.io.min.js"></script>
</head>
<body>
    <button>向服务端发送消息</button>
</body>
<script>
    const ws = io.connect("/");
    const btn = document.querySelector("button");
    btn.onclick = function(){
        ws.emit("one",1,2,3,4);

    }
    ws.on("two",function(a,b,c,d){
        console.log("接收服务端过来的信息",a,b,c,d);
    })
</script>
</html>